package com.lining.orangeservice.mapper;

import com.lining.orangeservice.entity.po.ApiLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface ApiLogMapper {
    @Insert({
        "INSERT INTO sys_api_log (",
        "user_id, username, api_name, request_url, request_method,",
        "request_params, response_result, ip_address, user_agent,",
        "execute_time, status_code, create_time",
        ") VALUES (",
        "#{userId}, #{username}, #{apiName}, #{requestUrl}, #{requestMethod},",
        "#{requestParams}, #{responseResult}, #{ipAddress}, #{userAgent},",
        "#{executeTime}, #{statusCode}, NOW()",
        ")"
    })
    void insertApiLog(ApiLog apiLog);
}
